package com.salton123.soulove.sailfish.video.ui.fm

import android.os.Bundle
import androidx.fragment.app.Fragment
import com.alibaba.android.arouter.facade.annotation.Route
import com.salton123.soulove.app.R
import com.salton123.soulove.common.Constants
import com.salton123.soulove.sailfish.video.ui.adapter.VideoCategotyAdapter
import com.salton123.ui.base.BaseFragment
import kotlinx.android.synthetic.main.fragment_video_category.*

/**
 * Time:1/17/22 4:41 PM
 * Author:
 * Description:
 */
@Route(path = Constants.Router.Video.CATEGORY)
class VideoCategoryFragment : BaseFragment() {
    companion object {
        const val TAG = "VideoCategoryFragment"
    }

    private val mAdapter by lazy { VideoCategotyAdapter(childFragmentManager, dataList) }
    private val dataList: MutableList<Pair<String, Fragment>> = mutableListOf(
        Pair("home", VideoHomeFragment()),
        Pair("list", VideoListFragment())
    )

    override fun enableTitleBar(): Boolean = false
    override fun getLayoutId(): Int = R.layout.fragment_video_category
    override fun isAsyncContentView(): Boolean = false
    override fun initViewAndData(savedInstanceState: Bundle?) {
        viewPager.offscreenPageLimit = dataList.size
        viewPager.adapter = mAdapter
        bottomBarLayout.apply {
            setViewPager(viewPager)
        }
    }
}